home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / maestro / source / displytl / displytl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-15  |  5.6 KB  |  230 lines

  1. #ifndef _DisplayToolHeader_
  2. #define _DisplayToolHeader_
  3. /*
  4.  * Copyright (c) 1990, 1991, 1992 Stanford University
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software and 
  7.  * its documentation for any purpose is hereby granted without fee, provided
  8.  * that (i) the above copyright notices and this permission notice appear in
  9.  * all copies of the software and related documentation, and (ii) the name
  10.  * Stanford may not be used in any advertising or publicity relating to
  11.  * the software without the specific, prior written permission of
  12.  * Stanford.
  13.  * 
  14.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  15.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  16.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  17.  *
  18.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
  19.  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
  20.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT
  21.  * ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY,
  22.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23.  * SOFTWARE.
  24.  */
  25. #include <stdio.h>
  26. #include <sys/param.h>
  27. #include <sys/types.h>
  28. #include <ctype.h>
  29. #include <X11/X.h>
  30. #include <X11/Xos.h>
  31. #include <X11/Xlib.h>
  32. #include <X11/Xutil.h>
  33. #include <X11/cursorfont.h>
  34. #include <X11/keysym.h>
  35. #include <xview/canvas.h>
  36. #include <xview/cms.h>
  37. #include <xview/cursor.h>
  38. #include <xview/xview.h>
  39. #include <xview/panel.h>
  40. #include <xview/font.h>
  41. #include <xview/frame.h>
  42. #include <xview/scrollbar.h>
  43. #include <xview/textsw.h>
  44. #include <xview/xv_xrect.h>
  45. #include <xview/svrimage.h>
  46. #include <xview/icon.h>
  47. #include <xview/notice.h>
  48. #include <xview/notify.h>
  49. #include <gdd.h>
  50. #include <gcm.h>
  51. #include "DisplayTool_ui.h"
  52. #include "xvimage.h"
  53. #include <Sender.h>
  54. #include <Receiver.h>
  55. #include <getopt.h>
  56. #include <Browse.h>
  57.  
  58.  
  59. /*
  60.  *   program constants
  61.  */ 
  62. #define IconX 64
  63. #define IconY 64
  64. #define Depth 8
  65. #define NumColors 256
  66. #define MaxNumImages 512
  67. #define MaxNumSlides 36
  68. #define FullWidth 1122
  69. #define FullHeight 852
  70. #define SmallWidth 192
  71. #define SmallHeight 154
  72. #define Small 0
  73. #define Large 1
  74. #define CancelQuit 0
  75. #define MaxLength MAXPATHLEN
  76. #define AllSizes -1
  77. #define NotInBuffer -1
  78. #define SlidesPerRow 3
  79. #undef  None
  80. #define None -1
  81. #define Red 0
  82. #define Green 1
  83. #define Blue 2
  84. #define BorderOffset 208
  85. #define Correction 3
  86. #define Cancel 0
  87. #define Confirm 1
  88.  
  89. /*
  90.  *  program type structures
  91.  */
  92. struct ImageStruct 
  93. {
  94.   int        origWidth, origHeight;
  95.   int        largeWidth, largeHeight;
  96.   int        galleryWidth, galleryHeight;
  97.   char*        filename;
  98.   char*        format;
  99.   byte*        imageData;
  100.   XImage*    galleryImage;
  101.   XImage*    slideImage;
  102.   XImage*    largeImage;
  103.   int        numcols;
  104.   int        nfcols;
  105.   unsigned long    cols[NumColors];
  106.   unsigned long freecols[NumColors];
  107.   int        slide;
  108.   XPoint    corner;
  109. };
  110.  
  111. struct SlideStruct
  112. {
  113.   char*    duration;
  114.   char*    label;
  115.   int    numberOfImages;
  116.   int    imageIds[MaxNumImages/2];
  117. };
  118.  
  119. typedef struct SlideStruct *SCR;
  120. typedef struct ImageStruct *IMAGE;
  121.  
  122. /*
  123.  * function declarations - prototypes
  124.  */
  125. void  LoadImage(),
  126.   CanvasEventProc(),
  127.   ShowPopup(),
  128.   HidePopup(),
  129.   HighlightImage(),
  130.   ResizeImage(),
  131.   RedrawRectangles(),
  132.   SlidesRepaint(),
  133.   GalleryRepaint(),
  134.   PopupRepaint(),
  135.   WriteSlideInfoToPanel(int i),
  136.   Reverse(char *string),
  137.   WriteSequenceToFile(),
  138.   GetOffsets(),
  139.   CropIfNecessary(),
  140.   FreeImage(),
  141.   CopyImage(),
  142.   SetTotalNumberOfSlides(),
  143.   CheckGeometry(),
  144.   FreeColors(),
  145.   CheckOptions(),
  146.   DisplayMultipleWindows(),
  147.   PrepareMultipleWindowsForDisplay(),
  148.   SetCurrentSlide(),
  149.   PrintCmap(),
  150.   NullFields(),
  151.   CreateCopyOfImage(),
  152.   SlideEventUp(),
  153.   SlideEventDown(),
  154.   SlideEventResize(),
  155.   PlaceImage(),
  156.   EraseOldImage(),
  157.   DrawNewImage(),
  158.   NoImageSelected(),
  159.   ClearList(),
  160.   KillPopups();
  161. void    LoadGalleryImage(char *file);
  162. void    HighlightGalleryImage(int imageNum, int oldImageNum);
  163. void    DisplayImages(int slideNum);
  164. void    KillOldPopupsOnly(void);
  165. char*    MyMalloc(unsigned int size);
  166. void    PrintDTDiagnostics(char* theString);
  167. Menu_item    ClearAll(Menu_item item, Menu_generate op);
  168. void    ShowFullSize(Panel_item item, int value, Event *event);
  169. void    FreeMemoryForSlide(int slideNum);
  170. void    PaintSlideImage(IMAGE theImage, int srcX, int srcY, int destX, int destY);
  171. void    GetEffectiveDimensions(IMAGE tempImage, int *width, int *height);
  172. void    InitSlide(SCR theSlide);
  173. void    PaintSlide(int slideNum);
  174. void    PaintGalleryImage(int imageNum);
  175. void    BusyApp(void);
  176. void    NormalApp(void);
  177.  
  178.  
  179.  
  180. int   WhichImage(),
  181.   WhichSlide(),
  182.   CheckChanges(),
  183.   OpenHandler(),
  184.   SaveHandler(),         
  185.   OpenEditFile(),
  186.   GetMaxSlide(),
  187.   AlreadyInGalleryBuffer(),
  188.   NotifyChoice(),
  189.   AlreadyInSlidesBuffer();
  190.  
  191. char *getwd();
  192. char *realpath();
  193.  
  194. IMAGE        CreateImage(char* file);
  195. IMAGE        ReCreateImage(IMAGE image);
  196. IMAGE        xvimage_main(char* file);
  197. XImage*        Resize(byte*    origData,
  198.                int    origWidth, int origHeight,
  199.                int    newWidth, int newHeight);
  200.  
  201. Frame        PopupCreate(Frame owner, int width, int height);
  202. Canvas        CanvasCreate(Frame owner, int width, int height);
  203. Menu_item    ClearSlide(Menu_item, Menu_generate);
  204. Menu_item    InsertNewSlide(Menu_item, Menu_generate);
  205. Notify_value    QuitNotify();
  206. Notify_value    IncrementCounter();
  207. Notify_value    GalleryEventProc(Xv_window win,Event* event,Notify_arg arg, Notify_event_type type);
  208. Notify_value    SlidesEventProc(Xv_window win,Event* event,Notify_arg arg, Notify_event_type type);
  209.  
  210.  
  211. /*
  212.  *  Networking functions and variables
  213.  */
  214. void OpenDoc(),
  215.   SetSelection(),
  216.   PerformSelection(),
  217.   HaltSelection(),
  218.   PauseSelection(),
  219.   ResumeSelection(),
  220.   HideApplication(),
  221.   ShowApplication();
  222.  
  223. char **GetDoc();
  224. MAESelection   *GetSelection();
  225. IconData       *GetAppIcon();
  226.  
  227. void UpdateHeader(int);
  228.  
  229. #endif  _DisplayToolHeader_
  230.